package com.zoro.barn.commons.tools.encryption;

import org.apache.commons.codec.digest.DigestUtils;

/**
 * md5
 * @author zhaoxingwu
 */
public class EncryptUtils {

    public static String md5Encode(String text) {
        if (text == null || text.isBlank()) {
            return null;
        }
        return DigestUtils.md5Hex(text);
    }

    public static String sha256(String text) {
        if (text == null || text.isBlank()) {
            return null;
        }
        return DigestUtils.sha256Hex(text);
    }

}
